﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace DisplayBoardInfo.Server.Forms.Board
{
    /// <summary>
    /// Interaction logic for StatusBox.xaml
    /// </summary>
    public partial class StatusBox : UserControl
    {
        private Session.SessionStatus status;

        public Session.SessionStatus Status
        {
            get { return status; }
            set 
            { 
                status = value;
                StatusChanged();
            }
        }

        public StatusBox()
        {
            InitializeComponent();

            Status = Session.SessionStatus.NiePrzyjmuje;
        }

        private void StatusChanged()
        {
            BrushConverter converter = new BrushConverter();
            switch (this.status)
            { 
                case Session.SessionStatus.NiePrzyjmuje :
                    LabelBackground.Background = (Brush)converter.ConvertFromString("#BE0026");
                    label.Content = "NIE PRZYJMUJE";
                    break;
                case Session.SessionStatus.Przerwa :
                    LabelBackground.Background = (Brush)converter.ConvertFromString("#FFAE00");
                    label.Content = "PRZERWA";
                    break;
                case Session.SessionStatus.Przyjmuje :
                    LabelBackground.Background = (Brush)converter.ConvertFromString("#71BA38");
                    label.Content = "PRZYJMUJE";
                    break;
            }
        }
    }
}
